{% if entry.id %}
  {% assign title = entry.title | markdownify | strip_html %}
{% else %}
  {% assign title = entry.title | markdownify %}
{% endif %}

<article class="entry h-entry">
  <header class="entry-header">
    <h3 class="entry-title p-name">
      {% if entry.link %}
        <a class="u-bookmark-of" href="{{ entry.link }}">{{ title }}</a> <a href="{{ entry.url | relative_url }}" rel="bookmark"><span class="link-arrow">&rarr;</span></a>
      {% else %}
        <a href="{{ entry.url | relative_url }}" rel="bookmark">{{ title }}</a>
      {% endif %}
    </h3>
    {% if entry.image.thumbnail %}
      {% assign entry_image = entry.image.thumbnail %}
      {% unless entry_image contains '://' %}
        {% assign entry_image = entry_image | relative_url %}
      {% endunless %}
      {% assign entry_image = entry_image | escape %}
      <img class="entry-image u-photo" src="{{ entry_image }}" alt="">
    {% endif %}
  </header>
  {% unless page.show_excerpts == false %}
    <div class="entry-excerpt p-summary">
      {% if entry.excerpt %}
        {% assign read_more_text = site.data.text[site.locale].read_more | prepend: "<br/>" %}
        {% capture read_more %}
          <span class="more-link">{{ read_more_text }}</span>
        {% endcapture %}
        {{ entry.excerpt | strip | remove: "<p>" | replace: "</p>", read_more | markdownify }}
      {% endif %}
    </div>
  {% endunless %}
  {% if site.read_time or entry.date and page.layout != 'collection' %}
    <footer class="entry-meta">
      {% if site.read_time %}{% include read-time.html %}{% endif %}
      {% if entry.date %}{% include entry-date.html %}{% endif %}
    </footer>
  {% endif %}
</article>
